home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tex / newalpha.bst < prev    next >
Encoding:
Text File  |  1988-04-18  |  16.4 KB  |  908 lines

  1. % modified version of the alpha bibliography style supporting my
  2. % bibliography conventions
  3. %
  4. % **********************************************************
  5. % ***** This will not work with BibTeX 0.99a or later ******
  6. % **********************************************************
  7. %
  8. %
  9. % changes:
  10.     % uses \em instead of \it
  11.     % emits "Ph.D. dissertation" instead of "PhD thesis"
  12.     % removed the "*" in more than four author cites
  13.     % sorts entries on (1) key, (2) author, (3) order of
  14.     %   reference, etc.  (3) is the added key.  Bibtex
  15.     %   tends to perturb the order of references.  This
  16.     %   adjusts that
  17. %
  18. % Richard Furuta
  19. % Department of Computer Science
  20. % University of Maryland
  21. % College Park, MD  20742
  22. %
  23. % furuta@mimsy.umd.edu
  24. % seismo!umcp-cs!furuta
  25. %
  26. % October 22, 1986, first release
  27. %
  28. %
  29. % Original version information:
  30. % BibTeX standard bibliography style `alpha'
  31.     % version 0.98c for BibTeX versions 0.98i or later, LaTeX version 2.08
  32.     % Copyright (C) 1985, all rights reserved
  33.     % Copying of this file is authorized only if either
  34.     % (1) you make absolutely no changes to your copy, including name, or
  35.     % (2) if you do make changes, you name it something other than
  36.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst
  37.     % This restriction helps ensure that all standard styles are identical
  38.  
  39. ENTRY
  40.   { address
  41.     author
  42.     booktitle
  43.     chapter
  44.     edition
  45.     editor
  46.     howpublished
  47.     institution
  48.     journal
  49.     key
  50.     month
  51.     note
  52.     number
  53.     organization
  54.     pages
  55.     publisher
  56.     school
  57.     series
  58.     title
  59.     type
  60.     volume
  61.     year
  62.   }
  63.   {}
  64.   { label extra.label sort.label }
  65.  
  66. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  67.  
  68. FUNCTION {init.state.consts}
  69. { 'before.all #0 :=
  70.   'mid.sentence #1 :=
  71.   'after.sentence #2 :=
  72.   'after.block #3 :=
  73. }
  74.  
  75. STRINGS { s t }
  76.  
  77. FUNCTION {output.nonnull}
  78. { 's swap$ :=
  79.   output.state mid.sentence =
  80.     { ", " * write$ }
  81.     { output.state after.block =
  82.     { add.period$ write$
  83.       newline$
  84.       "\newblock " write$
  85.     }
  86.     { output.state before.all =
  87.         'write$
  88.         { add.period$ " " * write$ }
  89.       if$
  90.     }
  91.       if$
  92.     }
  93.   if$
  94.   'output.state mid.sentence :=
  95.   s
  96. }
  97.  
  98. FUNCTION {output}
  99. { 's swap$ :=
  100.   s "" =
  101.     'skip$
  102.     { s output.nonnull }
  103.   if$
  104. }
  105.  
  106. FUNCTION {output.check}
  107. { 's swap$ :=
  108.   't swap$ :=
  109.   s "" =
  110.     { "Warning: the " t * " shouldn't be empty in " * cite$ * top$ }
  111.     { s output.nonnull }
  112.   if$
  113. }
  114.  
  115. FUNCTION {output.bibitem}
  116. { newline$
  117.   "\bibitem[" write$
  118.   label write$
  119.   "]{" write$
  120.   cite$ write$
  121.   "}" write$
  122.   newline$
  123.   ""
  124.   'output.state before.all :=
  125. }
  126.  
  127. FUNCTION {fin.entry}
  128. { add.period$
  129.   write$
  130.   newline$
  131. }
  132.  
  133. FUNCTION {new.block}
  134. { output.state before.all =
  135.     'skip$
  136.     { 'output.state after.block := }
  137.   if$
  138. }
  139.  
  140. FUNCTION {new.sentence}
  141. { output.state after.block =
  142.     'skip$
  143.     { output.state before.all =
  144.     'skip$
  145.     { 'output.state after.sentence := }
  146.       if$
  147.     }
  148.   if$
  149. }
  150.  
  151. FUNCTION {not}
  152. {   { #0 }
  153.     { #1 }
  154.   if$
  155. }
  156.  
  157. FUNCTION {and}
  158. {   'skip$
  159.     { pop$ #0 }
  160.   if$
  161. }
  162.  
  163. FUNCTION {or}
  164. {   { pop$ #1 }
  165.     'skip$
  166.   if$
  167. }
  168.  
  169. FUNCTION {field.or.null}
  170. { duplicate$
  171.   missing$
  172.     { pop$ "" }
  173.     'skip$
  174.   if$
  175. }
  176.  
  177. FUNCTION {italicize}
  178. { 's swap$ :=
  179.   s "" =
  180.     { "" }
  181.     { "{\em " s * "}" * }
  182.   if$
  183. }
  184.  
  185. INTEGERS { nameptr namesleft numnames }
  186.  
  187. STRINGS {nameresult}
  188.  
  189. FUNCTION {format.names}
  190. { 's swap$ :=
  191.   'nameptr #1 :=
  192.   'nameresult "" :=
  193.   'numnames s num.names$ :=
  194.   'namesleft numnames :=
  195.     { namesleft #0 > }
  196.     {
  197.       't s nameptr "{ff }{vv~}{ll}{, jj}" format.name$ :=
  198.       nameptr #1 >
  199.     { namesleft #1 >
  200.         { 'nameresult nameresult ", " * t * := }
  201.         { numnames #2 >
  202.         { 'nameresult nameresult "," * := }
  203.         'skip$
  204.           if$
  205.           t "others" =
  206.         { 'nameresult nameresult " et al." * := }
  207.         { 'nameresult nameresult " and " * t * := }
  208.           if$
  209.         }
  210.       if$
  211.     }
  212.     { 'nameresult nameresult t * := }
  213.       if$
  214.       'nameptr nameptr #1 + :=
  215.       'namesleft namesleft #1 - :=
  216.     }
  217.   while$
  218.   nameresult
  219. }
  220.  
  221. FUNCTION {format.authors}
  222. { author missing$
  223.     { "" }
  224.     { author format.names }
  225.   if$
  226. }
  227.  
  228. FUNCTION {format.editors}
  229. { editor missing$
  230.     { "" }
  231.     { editor num.names$ #1 >
  232.     { editor format.names ", editors" * }
  233.     { editor format.names ", editor" * }
  234.       if$
  235.     }
  236.   if$
  237. }
  238.  
  239. FUNCTION {format.title}
  240. { title missing$
  241.     { "" }
  242.     { title "ul" change.case$ }
  243.   if$
  244. }
  245.  
  246. FUNCTION {entry.string.max} { #100 }
  247.  
  248. FUNCTION {global.string.max} { #300 }
  249.  
  250. STRINGS {pageresult}
  251.  
  252. FUNCTION {n.dashify}
  253. { 't swap$ :=
  254.   'pageresult "" :=
  255.     { t "" = not }
  256.     { t #1 #1 substring$ "-" =
  257.     { t #1 #2 substring$ "--" = not
  258.         { 'pageresult pageresult "--" * :=
  259.           't t #2 global.string.max substring$ :=
  260.         }
  261.         {   { t #1 #1 substring$ "-" = }
  262.         { 'pageresult pageresult "-" * :=
  263.           't t #2 global.string.max substring$ :=
  264.         }
  265.           while$
  266.         }
  267.       if$
  268.     }
  269.     { 'pageresult pageresult t #1 #1 substring$ * :=
  270.       't t #2 global.string.max substring$ :=
  271.     }
  272.       if$
  273.     }
  274.   while$
  275.   pageresult
  276. }
  277.  
  278. FUNCTION {format.date}
  279. { year missing$
  280.     { month missing$
  281.     { "" }
  282.     { "Warning: there's a month but no year in " cite$ * top$
  283.       month
  284.     }
  285.       if$
  286.     }
  287.     { month missing$
  288.     { year }
  289.     { month " " * year * }
  290.       if$
  291.     }
  292.   if$
  293. }
  294.  
  295. FUNCTION {format.btitle}
  296. { title field.or.null
  297.   italicize
  298. }
  299.  
  300. FUNCTION {format.bvolume}
  301. { volume missing$
  302.     { series missing$
  303.     { "" }
  304.     { series italicize }
  305.       if$
  306.     }
  307.     { "Volume~" volume *
  308.       series missing$
  309.     'skip$
  310.     { " of " * series italicize * }
  311.       if$
  312.     }
  313.   if$
  314. }
  315.  
  316. FUNCTION {format.edition}
  317. { edition missing$
  318.     { "" }
  319.     { edition "ll" change.case$ " edition" * }
  320.   if$
  321. }
  322.  
  323. INTEGERS {multiresult}
  324.  
  325. FUNCTION {multi.page.check}
  326. { 't swap$ :=
  327.   'multiresult #0 :=
  328.     { multiresult not
  329.       t "" = not
  330.       and
  331.     }
  332.     { t #1 #1 substring$ "-" =
  333.       t #1 #1 substring$ "," =
  334.       or
  335.     { 'multiresult #1 := }
  336.     { 't t #2 global.string.max substring$ := }
  337.       if$
  338.     }
  339.   while$
  340.   multiresult
  341. }
  342.  
  343. FUNCTION {format.pages}
  344. { pages missing$
  345.     { "" }
  346.     { pages multi.page.check
  347.     { "pages~" pages n.dashify * }
  348.     { "page~" pages n.dashify * }
  349.       if$
  350.     }
  351.   if$
  352. }
  353.  
  354. FUNCTION {format.vol.num.pages}
  355. { volume field.or.null
  356.   number missing$
  357.     'skip$
  358.     { "(" number * ")" * *
  359.       volume missing$
  360.     { "Warning: there's a number but no volume in " cite$ * top$ }
  361.     'skip$
  362.       if$
  363.     }
  364.   if$
  365.   pages missing$
  366.     'skip$
  367.     { duplicate$ "" =
  368.     'skip$
  369.     { ":" * }
  370.       if$
  371.       pages n.dashify *
  372.     }
  373.   if$
  374. }
  375.  
  376. FUNCTION {format.chapter.pages}
  377. { chapter missing$
  378.     'format.pages
  379.     { "chapter~" chapter *
  380.       pages missing$
  381.     'skip$
  382.     { ", " * format.pages * }
  383.       if$
  384.     }
  385.   if$
  386. }
  387.  
  388. FUNCTION {format.in.ed.booktitle}
  389. { booktitle missing$
  390.     { "" }
  391.     { 's format.editors :=
  392.       s "" =
  393.     { "In " booktitle italicize * }
  394.     { "In " s * ", " * booktitle italicize * }
  395.       if$
  396.     }
  397.   if$
  398. }
  399.  
  400. FUNCTION {format.tr.number}
  401. { type missing$
  402.     { "Technical Report" }
  403.     { type }
  404.   if$
  405.   number missing$
  406.     'skip$
  407.     { "~" * number * }
  408.   if$
  409. }
  410.  
  411. FUNCTION {article}
  412. { output.bibitem
  413.   "author" format.authors output.check
  414.   new.block
  415.   "title" format.title output.check
  416.   new.block
  417.   "journal" journal field.or.null italicize output.check
  418.   format.vol.num.pages output
  419.   "year" format.date output.check
  420.   new.block
  421.   note field.or.null output
  422.   fin.entry
  423. }
  424.  
  425. FUNCTION {book}
  426. { output.bibitem
  427.   author missing$
  428.     { "author and editor" format.editors output.check }
  429.     { "author" format.authors output.check }
  430.   if$
  431.   new.block
  432.   "title" format.btitle output.check
  433.   new.block
  434.   format.bvolume output
  435.   "publisher" publisher field.or.null output.check
  436.   address field.or.null output
  437.   format.edition output
  438.   "year" format.date output.check
  439.   new.block
  440.   note field.or.null output
  441.   fin.entry
  442. }
  443.  
  444. FUNCTION {booklet}
  445. { output.bibitem
  446.   format.authors output
  447.   new.block
  448.   "title" format.btitle output.check
  449.   new.block
  450.   howpublished field.or.null output
  451.   address field.or.null output
  452.   format.date output
  453.   new.block
  454.   note field.or.null output
  455.   fin.entry
  456. }
  457.  
  458. FUNCTION {inbook}
  459. { output.bibitem
  460.   author missing$
  461.     { "author and editor" format.editors output.check }
  462.     { "author" format.authors output.check }
  463.   if$
  464.   new.block
  465.   "title" format.btitle output.check
  466.   "chapter and pages" format.chapter.pages output.check
  467.   new.block
  468.   format.bvolume output
  469.   "publisher" publisher field.or.null output.check
  470.   address field.or.null output
  471.   format.edition output
  472.   "year" format.date output.check
  473.   new.block
  474.   note field.or.null output
  475.   fin.entry
  476. }
  477.  
  478. FUNCTION {incollection}
  479. { output.bibitem
  480.   "authors" format.authors output.check
  481.   new.block
  482.   "title" format.title output.check
  483.   new.block
  484.   "booktitle" format.in.ed.booktitle output.check
  485.   format.chapter.pages output
  486.   "publisher" publisher field.or.null output.check
  487.   address field.or.null output
  488.   "year" format.date output.check
  489.   new.block
  490.   note field.or.null output
  491.   fin.entry
  492. }
  493.  
  494. FUNCTION {inproceedings}
  495. { output.bibitem
  496.   "author" format.authors output.check
  497.   new.block
  498.   "title" format.title output.check
  499.   new.block
  500.   "booktitle" format.in.ed.booktitle output.check
  501.   format.pages output
  502.   organization field.or.null output
  503.   publisher field.or.null output
  504.   address field.or.null output
  505.   "year" format.date output.check
  506.   new.block
  507.   note field.or.null output
  508.   fin.entry
  509. }
  510.  
  511. FUNCTION {conference} { inproceedings }
  512.  
  513. FUNCTION {manual}
  514. { output.bibitem
  515.   format.authors output
  516.   new.block
  517.   "title" format.btitle output.check
  518.   new.block
  519.   organization field.or.null output
  520.   address field.or.null output
  521.   format.edition output
  522.   format.date output
  523.   new.block
  524.   note field.or.null output
  525.   fin.entry
  526. }
  527.  
  528. FUNCTION {mastersthesis}
  529. { output.bibitem
  530.   "author" format.authors output.check
  531.   new.block
  532.   "title" format.btitle output.check
  533.   new.block
  534.   "Master's thesis" output
  535.   "school" school field.or.null output.check
  536.   address field.or.null output
  537.   "year" format.date output.check
  538.   new.block
  539.   note field.or.null output
  540.   fin.entry
  541. }
  542.  
  543. FUNCTION {misc}
  544. { output.bibitem
  545.   format.authors output
  546.   new.block
  547.   format.title output
  548.   new.block
  549.   howpublished field.or.null output
  550.   format.date output
  551.   new.block
  552.   note field.or.null output
  553.   fin.entry
  554. }
  555.  
  556. FUNCTION {phdthesis}
  557. { output.bibitem
  558.   "author" format.authors output.check
  559.   new.block
  560.   "title" format.btitle output.check
  561.   new.block
  562.   "Ph.D.\ dissertation" output
  563.   "school" school field.or.null output.check
  564.   address field.or.null output
  565.   "year" format.date output.check
  566.   new.block
  567.   note field.or.null output
  568.   fin.entry
  569. }
  570.  
  571. FUNCTION {proceedings}
  572. { output.bibitem
  573.   editor missing$
  574.     { organization missing$
  575.     'skip$
  576.     { organization field.or.null output }
  577.       if$
  578.     }
  579.     { format.editors output }
  580.   if$
  581.   new.block
  582.   "title" format.btitle output.check
  583.   editor missing$
  584.     'skip$
  585.     { organization field.or.null output }
  586.   if$
  587.   publisher field.or.null output
  588.   address field.or.null output
  589.   "year" format.date output.check
  590.   new.block
  591.   note field.or.null output
  592.   fin.entry
  593. }
  594.  
  595. FUNCTION {techreport}
  596. { output.bibitem
  597.   "author" format.authors output.check
  598.   new.block
  599.   "title" format.btitle output.check
  600.   new.block
  601.   format.tr.number output
  602.   "institution" institution field.or.null output.check
  603.   address field.or.null output
  604.   "year" format.date output.check
  605.   new.block
  606.   note field.or.null output
  607.   fin.entry
  608. }
  609.  
  610. FUNCTION {unpublished}
  611. { output.bibitem
  612.   "author" format.authors output.check
  613.   new.block
  614.   "title" format.title output.check
  615.   new.block
  616.   format.date output
  617.   new.block
  618.   "note" note field.or.null output.check
  619.   fin.entry
  620. }
  621.  
  622. FUNCTION {default.type} { book }
  623.  
  624. MACRO {jan} {"January"}
  625.  
  626. MACRO {feb} {"February"}
  627.  
  628. MACRO {mar} {"March"}
  629.  
  630. MACRO {apr} {"April"}
  631.  
  632. MACRO {may} {"May"}
  633.  
  634. MACRO {jun} {"June"}
  635.  
  636. MACRO {jul} {"July"}
  637.  
  638. MACRO {aug} {"August"}
  639.  
  640. MACRO {sep} {"September"}
  641.  
  642. MACRO {oct} {"October"}
  643.  
  644. MACRO {nov} {"November"}
  645.  
  646. MACRO {dec} {"December"}
  647.  
  648. MACRO {acmcs} {"ACM Computing Surveys"}
  649.  
  650. MACRO {acta} {"Acta Informatica"}
  651.  
  652. MACRO {cacm} {"Communications of the ACM"}
  653.  
  654. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  655.  
  656. MACRO {ibmsj} {"IBM Systems Journal"}
  657.  
  658. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  659.  
  660. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  661.  
  662. MACRO {ieeetcad}
  663.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  664.  
  665. MACRO {ipl} {"Information Processing Letters"}
  666.  
  667. MACRO {jacm} {"Journal of the ACM"}
  668.  
  669. MACRO {jcss} {"Journal of Computer and System Sciences"}
  670.  
  671. MACRO {scp} {"Science of Computer Programming"}
  672.  
  673. MACRO {sicomp} {"SIAM Journal on Computing"}
  674.  
  675. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  676.  
  677. MACRO {tods} {"ACM Transactions on Database Systems"}
  678.  
  679. MACRO {tog} {"ACM Transactions on Graphics"}
  680.  
  681. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  682.  
  683. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  684.  
  685. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  686.  
  687. MACRO {tcs} {"Theoretical Computer Science"}
  688.  
  689. READ
  690.  
  691. FUNCTION {sortify}
  692. { purify$
  693.   "ll" change.case$
  694. }
  695.  
  696. FUNCTION {format.lab.names}
  697. { 's swap$ :=
  698.   'numnames s num.names$ :=
  699.   numnames #1 >
  700.     { numnames #4 >
  701.     { 'namesleft #4 := }
  702.     { 'namesleft numnames := }
  703.       if$
  704.       'nameptr #1 :=
  705.       'nameresult "" :=
  706.     { namesleft #0 > }
  707.     { nameptr numnames =
  708.         { s nameptr "{ff}{vv}{ll}{jj}" format.name$ "others" =
  709.         { 'nameresult nameresult "*" * := }
  710.         { 'nameresult nameresult s nameptr "{v{}}{l{}}" format.name$
  711.           * :=
  712.         }
  713.           if$
  714.         }
  715.         { 'nameresult nameresult s nameptr "{v{}}{l{}}" format.name$
  716.           * :=
  717.         }
  718.       if$
  719.       'nameptr nameptr #1 + :=
  720.       'namesleft namesleft #1 - :=
  721.     }
  722.       while$
  723. %      numnames #4 >
  724. %    { 'nameresult nameresult "*" * := }
  725. %    'skip$
  726. %      if$
  727.     }
  728.     { 't s #1 "{v{}}{l{}}" format.name$ :=
  729.       'nameresult
  730.       t #2 #1 substring$ "" =
  731.     { s #1 "{ll}" format.name$ purify$ #1 #3 substring$ }
  732.     { t }
  733.       if$
  734.       :=
  735.     }
  736.   if$
  737.   nameresult
  738. }
  739.  
  740. FUNCTION {calc.label}
  741. { 'label
  742.   author missing$
  743.     { editor missing$
  744.     { key missing$
  745.         { "Warning: need a key to make a label in " cite$ * top$
  746.           title field.or.null purify$ #1 #3 substring$
  747.         }
  748.         { key purify$ #1 #3 substring$ }
  749.       if$
  750.     }
  751.     { editor format.lab.names }
  752.       if$
  753.     }
  754.     { author format.lab.names }
  755.   if$
  756.   year field.or.null purify$ #-1 #2 substring$
  757.   *
  758.   :=
  759.   'sort.label label sortify :=
  760. }
  761.  
  762. FUNCTION {sort.format.names}
  763. { 's swap$ :=
  764.   'nameptr #1 :=
  765.   'nameresult "" :=
  766.   'numnames s num.names$ :=
  767.   'namesleft numnames :=
  768.     { namesleft #0 > }
  769.     { nameptr #1 >
  770.     { 'nameresult nameresult "   " * := }
  771.     'skip$
  772.       if$
  773.       't s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ :=
  774.       nameptr numnames = t "others" = and
  775.     { 'nameresult nameresult "et al" * := }
  776.     { 'nameresult nameresult t sortify * := }
  777.       if$
  778.       'nameptr nameptr #1 + :=
  779.       'namesleft namesleft #1 - :=
  780.     }
  781.   while$
  782.   nameresult
  783. }
  784.  
  785. INTEGERS {len}
  786.  
  787. FUNCTION {chop.word}
  788. { 's swap$ :=
  789.   'len swap$ :=
  790.   s #1 len substring$ =
  791.     { s len #1 + global.string.max substring$ }
  792.     { s }
  793.   if$
  794. }
  795.  
  796. FUNCTION {sort.format.title}
  797. { 't swap$ :=
  798.   "A " #2
  799.     "An " #3
  800.       "The " #4 t chop.word
  801.     chop.word
  802.   chop.word
  803.   #1 global.string.max substring$
  804.   sortify
  805. }
  806.  
  807. INTEGERS {pre.count}
  808.  
  809. FUNCTION {init.pre.count}
  810. {
  811.   'pre.count #0 :=
  812. }
  813.  
  814. EXECUTE {init.pre.count}
  815.  
  816. FUNCTION {presort}
  817. {
  818.   calc.label
  819.   sort.label
  820.   "    "
  821.   *
  822.   author missing$
  823.     { editor missing$
  824.     { key field.or.null sortify }
  825.     { editor sort.format.names }
  826.       if$
  827.     }
  828.     { author sort.format.names }
  829.   if$
  830.   *
  831.   "    "
  832.   *
  833.   'pre.count pre.count #1 + :=
  834.   pre.count int.to.str$
  835.   *
  836.   "    "
  837.   *
  838.   title field.or.null
  839.   sort.format.title
  840.   *
  841.   #1 entry.string.max substring$
  842.   'sort.key$ swap$ :=
  843. }
  844.  
  845. ITERATE {presort}
  846.  
  847. SORT
  848.  
  849. STRINGS { longest.label last.sort.label next.extra }
  850.  
  851. INTEGERS { longest.label.width last.extra.num }
  852.  
  853. FUNCTION {initialize.longest.label}
  854. { 'longest.label "" :=
  855.   'last.sort.label "" :=
  856.   'next.extra "" :=
  857.   'longest.label.width #0 :=
  858.   'last.extra.num #0 :=
  859. }
  860.  
  861. FUNCTION {forward.pass}
  862. { last.sort.label sort.label =
  863.     { 'last.extra.num last.extra.num #1 + :=
  864.       'extra.label last.extra.num int.to.chr$ :=
  865.     }
  866.     { 'last.extra.num "a" chr.to.int$ :=
  867.       'extra.label "" :=
  868.       'last.sort.label sort.label :=
  869.     }
  870.   if$
  871. }
  872.  
  873. FUNCTION {reverse.pass}
  874. { next.extra "b" =
  875.     { 'extra.label "a" := }
  876.     'skip$
  877.   if$
  878.   'label label extra.label * :=
  879.   label width$ longest.label.width >
  880.     { 'longest.label label :=
  881.       'longest.label.width label width$ :=
  882.     }
  883.     'skip$
  884.   if$
  885.   'next.extra extra.label :=
  886. }
  887.  
  888. EXECUTE {initialize.longest.label}
  889.  
  890. ITERATE {forward.pass}
  891.  
  892. REVERSE {reverse.pass}
  893.  
  894. FUNCTION {preamble}
  895. { "\begin{thebibliography}{"  longest.label  * "}" * write$
  896.   newline$
  897. }
  898.  
  899. EXECUTE {preamble}
  900.  
  901. EXECUTE {init.state.consts}
  902.  
  903. ITERATE {call.type$}
  904.  
  905. FUNCTION {finish.up} { newline$ "\end{thebibliography}" write$ newline$ }
  906.  
  907. EXECUTE {finish.up}
  908.